![]() |
Kinetis SDK Demo Applications User Guide
1.0.0-beta
Freescale Semiconductor, Inc.
|
Enumerations | |
| enum | _mma8451_i2c_constants { kMMA8451_I2C_Address, kMMA8451_I2C_Address_With_SAO_Set } |
| I2C related constants for the MMA8451. More... | |
Functions | |
| uint8_t | mma8451_read_register (const mma8451_device_t *device, uint8_t reg_addr) |
| Read a single register of the MMA8451. More... | |
| int32_t | mma8451_write_register (const mma8451_device_t *device, uint8_t reg_addr, uint8_t reg_val) |
| Write a single register of the MMA8451. More... | |
| int32_t | mma8451_init (mma8451_device_t *device, uint8_t i2c_addr, uint32_t baud_kbps) |
| Initialize the MMA8451 driver instance. More... | |
| int32_t | mma8451_get_acceleration (const mma8451_device_t *device, acceleration_t *accel) |
| Read the current acceleration values. More... | |
| int32_t mma8451_get_acceleration | ( | const mma8451_device_t * | device, |
| acceleration_t * | accel | ||
| ) |
| device | Pointer to a valid device instance structure. |
| accel | Pointer to a structure that will be filled in with the current acceleration values for all three axes. |
| kStatus_Success |
| int32_t mma8451_init | ( | mma8451_device_t * | device, |
| uint8_t | i2c_addr, | ||
| uint32_t | baud_kbps | ||
| ) |
| device | Device driver state structure that will be filled in by this function. It is the responsibility of the caller to provide storage for this structure, and to free that storage when the driver is no longer needed. |
| isSaoSet | |
| baud_kbps |
| kStatus_Success | |
| kMMA8451_Invalid_I2C_Address_Error |
| uint8_t mma8451_read_register | ( | const mma8451_device_t * | device, |
| uint8_t | reg_addr | ||
| ) |
| device | Pointer to a valid device instance structure. |
| reg_addr | Address of the internal MMA8451 register to read. |
| int32_t mma8451_write_register | ( | const mma8451_device_t * | device, |
| uint8_t | reg_addr, | ||
| uint8_t | reg_val | ||
| ) |
| device | Pointer to a valid device instance structure. |
| reg_addrAddress | of the internal MMA8451 register to change the value of. |
| reg_val | New value for the register. |
| kStatus_Success |